<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>默认参数</title>
</head>
<body>

<script>
    function f( a , b = "default" , c = 5) {
        return `${a} - ${b} - ${c}`;
    }
    console.log(f(5,6,7));
    console.log(f(5,6));
    console.log(f(5,6));
    console.log(f());
</script>
</body>
</html>